<?php
// -----------------------------------------------------------------------------
// include
// -----------------------------------------------------------------------------

include "../config/config.php";
include "../auth.php";
include "../DBManager.php";

// -----------------------------------------------------------------------------
// 数据库相关设置
// -----------------------------------------------------------------------------

$dbPath = "../" . $dbPath;
$db = new DBManager("sqlite:" . $dbPath);

// -----------------------------------------------------------------------------

$categories = $db->getListOfCategories();

echo "<div class='list-group'>";
foreach ($categories as $category) {

    $title = $category["title"];
    $sortNumber = $category["sortNumber"];

    echo <<<BBB
        <span role="button" 
              data-sortnumber="$sortNumber" 
              class='list-group-item list-group-item-action selectAsTarget text-break'>$title</span>
    BBB;

}
echo "</div>";
